<?php
include_once "../common/header_nologout.php";
?>

<script type="text/javascript">
function OnSubmitForm()
{
  if(document.login.name.value == 'Student')
  {
   document.login.action ="../student_home/index.php";
  }
  else
  if(document.login.name.value == 'Instructor')
  {
   document.login.action ="../instructor_home/index.php";
  }
  else
  if(document.login.name.value == 'TA')
  {
   document.login.action ="../ta_home/index.php";
  }
  else {
	document.login.action ="";
	alert("You have entered an invalid username or password.\n \nPlease verify that you are entering the correct username and password, then attempt to sign in again.");
  }
  return true;
}
</script>

<h2>Sign in to Moodle</h2>
<p>Please enter your login credentials below to sign in to Moodle.  If you have forgotten your password, you may recover it using the online <a href="">password recovery tool</a>.</p><br /><br /><br />
<center>
<div style="width:250px; text-align:center;">
<form id="login" name="login" method="post" onsubmit="return OnSubmitForm();">
<label style="float:left;">Username</label>
<input type="text" name="name" id="name" style="float:right;"/><br /><br /><br/>

<label style="float:left;">Password</label>
<input type="password" name="password" id="password" style="float:right;"/><br /><br /><br/>

<input type="submit" id="submit" class="fancybutton" value="Sign in">
&nbsp;&nbsp; | &nbsp;&nbsp;<a href="../index.php">Return home</a>

</form>
</div>
</center>

<?php
include_once "leftcol.php";
include_once "rightcol.php";
include_once "../common/footer.php";
?>
